package com.eugene.entity;

import java.io.Serializable;
import java.util.Date;

import com.eugene.element.FnCalendar;
import com.eugene.enums.EMaturity;
import com.eugene.interfaces.Calculable;

public class MvPairData implements Serializable, Calculable, Cloneable{
	private	FnCalendar baseDate;
	private FnCalendar fwdDate;

	private String mvPairId;
	public String getMvPairId() {
		return mvPairId;
	}
	public void setMvPairId(String mvPairId) {
		this.mvPairId = mvPairId;
	}

	private String mvDataId;
	private String refMvDataId;
	
	private String mvId;
	private EMaturity maturity;

	private String refMvId;
	private EMaturity refMaturity;

	private double mvValue;
	private double mvDerivedValue;

	private String sceId;
	private String sceSetId;
	private double sceValue;
	
	//	private Calendar lastUpdate;
	private Date lastUpdate;

	
	public MvPairData(){
		
	}
	public MvPairData(FnCalendar baseDate,String mvPairId,String mvId, String refMvId, double mvValue){
		this.baseDate = baseDate;
		this.mvPairId = mvPairId;
		this.mvId= mvId;
		this.refMvId = refMvId;
		this.mvValue = mvValue;
	}
	public MvPairData(FnCalendar baseDate,String mvId, String refMvId, double mvValue){
		this.baseDate = baseDate;
		this.mvId= mvId;
		this.refMvId = refMvId;
		this.mvValue = mvValue;
	}
	public MvPairData(FnCalendar baseDate,MvData mv, MvData refMv, double mvValue){
		this.baseDate = baseDate;
		this.mvId= mv.getMvId();
		this.maturity = mv.getMaturity();
		this.refMvId = refMv.getMvId();
		this.refMaturity = refMv.getMaturity();
		this.mvValue = mvValue;
	}
	
	public FnCalendar getBaseDate() {
		return baseDate;
	}

	public void setBaseDate(FnCalendar baseDate) {
		this.baseDate = baseDate;
	}

	public FnCalendar getFwdDate() {
		return fwdDate;
	}

	public void setFwdDate(FnCalendar fwdDate) {
		this.fwdDate = fwdDate;
	}

	public String getMvDataId() {
		return mvDataId;
	}

	public void setMvDataId(String mvDataId) {
		this.mvDataId = mvDataId;
	}

	public String getRefMvDataId() {
		return refMvDataId;
	}

	public void setRefMvDataId(String refMvDataId) {
		this.refMvDataId = refMvDataId;
	}

	public String getMvId() {
		return mvId;
	}

	public void setMvId(String mvId) {
		this.mvId = mvId;
	}

	public EMaturity getMaturity() {
		return maturity;
	}

	public void setMaturity(EMaturity maturity) {
		this.maturity = maturity;
	}

	public String getRefMvId() {
		return refMvId;
	}

	public void setRefMvId(String refMvId) {
		this.refMvId = refMvId;
	}

	public EMaturity getRefMaturity() {
		return refMaturity;
	}

	public void setRefMaturity(EMaturity refMaturity) {
		this.refMaturity = refMaturity;
	}

	public double getMvValue() {
		return mvValue;
	}

	public void setMvValue(double mvValue) {
		this.mvValue = mvValue;
	}

	public double getMvDerivedValue() {
		return mvDerivedValue;
	}

	public void setMvDerivedValue(double mvDerivedValue) {
		this.mvDerivedValue = mvDerivedValue;
	}

	
	public String getSceId() {
		return sceId;
	}

	public void setSceId(String sceId) {
		this.sceId = sceId;
	}

	public String getSceSetId() {
		return sceSetId;
	}
	public void setSceSetId(String sceSetId) {
		this.sceSetId = sceSetId;
	}

	public double getSceValue() {
		return sceValue;
	}

	public void setSceValue(double sceValue) {
		this.sceValue = sceValue;
	}

	public Date getLastUpdate() {
		return lastUpdate;
	}

	public void setLastUpdate(Date lastUpdate) {
		this.lastUpdate = lastUpdate;
	}


	@Override
	public boolean equals(Object other){
		return super.equals(other); 
	}
	@Override
	public int hashCode(){
		return super.hashCode();
	}
	@Override
	public double getValue(){
		return mvValue;
	}
	@Override
	public double getDerivedValue(){
		return mvDerivedValue;
	}
	@Override
	public void setValue(double value){
		mvValue = value;
	}
	@Override
	public double getDifferFrom(Calculable other){
		return this.getValue() - other.getValue();
	}
	
	@Override
	protected Object clone() throws CloneNotSupportedException {
		return super.clone();
	}
//	@Override
//	public List<MvPairData> getOperands(){
//		List<MvPairData> rst = new ArrayList<MvPairData>();
//		rst.add(this);
//		return rst;
//	}
}
